import request from '@/utils/request'

const test = params => {
  return request({
    url: `webapi/test?time=${Date.now()}`,
    method: 'GET',
    data: params
  })
}
//登录获取Token
const login = params => {
  return request({
    url: 'api/auth/login',
    method: 'POST',
    data: params
  })
}
//登录根据Token获取用户信息
const getUserInfo = () => {
  return request({
    url: `api/auth/getUserInfo?time=${Date.now()}`,
    method: 'GET'
  })
}

//获取矿山列表
const getKsStatistics = () => {
  return request({
    url: `api/Home/GetKsStatistics?time=${Date.now()}`,
    method: 'GET'
  })
}

//获取矿山列表
const getCamerasList = params => {
  return request({
    url: `api/Home/GetCamerasList?time=${Date.now()}`,
    method: 'POST',
    data: params
  })
}

//获取矿山列表
const previewURLs = params => {
  return request({
    url: 'api/HaiKang/previewURLs',
    method: 'POST',
    data: params
  })
}

// 获取矿山饼状图统计
const getKsPieChart = () => {
  return request({
    url: `api/Home/GetKsPieChartStatistics?time=${Date.now()}`,
    method: 'GET'
  })
}

export { test, login, getUserInfo, getKsStatistics, getCamerasList, previewURLs, getKsPieChart }
